package cn.yy.pojo;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Fees entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "fees", catalog = "phoneerp")
public class Fees implements java.io.Serializable {

	// Fields

	private Integer feesId;
	private String feesName;
	private Double freeMinus;
	private Double feesCount;
	private Double feesOrigin;
	private Double feesFinal;
	private Date date;
	private Integer accountId;
	private Set<Paybill> paybills = new HashSet<Paybill>(0);

	// Constructors

	/** default constructor */
	public Fees() {
	}

	/** minimal constructor */
	public Fees(String feesName, Double freeMinus, Double feesCount,
			Double feesOrigin, Double feesFinal, Date date, Integer accountId) {
		this.feesName = feesName;
		this.freeMinus = freeMinus;
		this.feesCount = feesCount;
		this.feesOrigin = feesOrigin;
		this.feesFinal = feesFinal;
		this.date = date;
		this.accountId = accountId;
	}

	/** full constructor */
	public Fees(String feesName, Double freeMinus, Double feesCount,
			Double feesOrigin, Double feesFinal, Date date, Integer accountId,
			Set<Paybill> paybills) {
		this.feesName = feesName;
		this.freeMinus = freeMinus;
		this.feesCount = feesCount;
		this.feesOrigin = feesOrigin;
		this.feesFinal = feesFinal;
		this.date = date;
		this.accountId = accountId;
		this.paybills = paybills;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "feesId", unique = true, nullable = false)
	public Integer getFeesId() {
		return this.feesId;
	}

	public void setFeesId(Integer feesId) {
		this.feesId = feesId;
	}

	@Column(name = "feesName", nullable = false, length = 20)
	public String getFeesName() {
		return this.feesName;
	}

	public void setFeesName(String feesName) {
		this.feesName = feesName;
	}

	@Column(name = "freeMinus", nullable = false, precision = 22, scale = 0)
	public Double getFreeMinus() {
		return this.freeMinus;
	}

	public void setFreeMinus(Double freeMinus) {
		this.freeMinus = freeMinus;
	}

	@Column(name = "feesCount", nullable = false, precision = 22, scale = 0)
	public Double getFeesCount() {
		return this.feesCount;
	}

	public void setFeesCount(Double feesCount) {
		this.feesCount = feesCount;
	}

	@Column(name = "feesOrigin", nullable = false, precision = 22, scale = 0)
	public Double getFeesOrigin() {
		return this.feesOrigin;
	}

	public void setFeesOrigin(Double feesOrigin) {
		this.feesOrigin = feesOrigin;
	}

	@Column(name = "feesFinal", nullable = false, precision = 22, scale = 0)
	public Double getFeesFinal() {
		return this.feesFinal;
	}

	public void setFeesFinal(Double feesFinal) {
		this.feesFinal = feesFinal;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "date", nullable = false, length = 10)
	public Date getDate() {
		return this.date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	@Column(name = "accountId", nullable = false)
	public Integer getAccountId() {
		return this.accountId;
	}

	public void setAccountId(Integer accountId) {
		this.accountId = accountId;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "fees")
	public Set<Paybill> getPaybills() {
		return this.paybills;
	}

	public void setPaybills(Set<Paybill> paybills) {
		this.paybills = paybills;
	}

}